import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    redirect: "/home/webHomepage"
  },
  {
    path: "/home",
    component: () => import("@/views/web-home.vue"),
    children: [
      {
        path: "webHomepage",
        name:"HomePage",
        component: () => import("@/pages/web-homepage.vue")
      },
      {
        path: "myhomepage",
        component: () => import("@/pages/web-myhomepage.vue")
      },
      {
        path: "diary",
        component: () => import("@/pages/web-diary.vue")
      },
      {
        path: "moment",
        component: () => import("@/pages/web-moment.vue")
      },
      {
        path: "set",
        component: () => import("@/pages/web-set.vue"),
        children: [
          {
            path: "userset",
            name: "userset",
            component: () => import("@/setpages/userset.vue")
          },
          {
            path: "secret",
            component: () => import("@/setpages/secret.vue")
          },
          {
            path: "head",
            name: "userHead",
            component: () => import("@/setpages/head.vue")
          },
          {
            path: "system",
            component: () => import("@/setpages/system.vue")
          },
          {
            path: "flower",
            component: () => import("@/setpages/flower.vue")
          },
          {
            path: "searchpassword",
            name: "resetEmail",
            component: () => import("@/setpages/searchpassword.vue")
          },
          {
            path: "resetpassword",
            name: "resetpassword",
            component: () => import("@/setpages/resetpassword.vue")
          },
        ]
      },
      {
        path: "reg",
        component: () => import("@/pages/web-reg.vue")
      },
      {
        path: "login",
        name:"Login",
        component: () => import("@/pages/web-login.vue")
      },
      {
        path: "userdiary",
        name:"userDiary",
        component: () => import("@/pages/user-diary.vue")
      },
      {
        path:"donation",
        component:()=>import("@/pages/web-donation.vue")
      },
      {
        path:"webreset",
        component:()=>import("@/pages/web-reset.vue")
      },
      {
        path:"webabout",
        component:()=>import("@/pages/web-about.vue")
      },
    ]
  },
  {
    path: "/message",
    name: "message",
    component: () => import("@/views/message.vue")
  }

]

const router = new VueRouter({
  routes
})

export default router
